home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / savage.zip / SAV55HRT.PAS < prev    next >
Pascal/Delphi Source File  |  1989-09-09  |  928b  |  38 lines

  1. program savage;         { 9/9/89, ljr }
  2.  
  3. uses tphrt;
  4.  
  5. const
  6.   iloop = 2500;
  7. var
  8.   hits, elapsed, i : longint;
  9.   a : real;
  10.  
  11.   function tan (a:real) : real;
  12.  
  13.   begin
  14.     tan := sin (a) / cos (a);
  15.   end;
  16.  
  17. begin
  18.   a := 1.0;
  19.   t_start;                             { init the timer }
  20.   writeln;
  21.   writeln ('SAVAGE BENCHMARK, (tp55 with high resolution timers).');
  22.   writeln;
  23.   write ('start...');
  24.   t_entry(1);                         { start the timer }
  25.   for i := 1 to iloop do begin
  26.       a := tan(arctan(exp(ln(sqrt(a * a))))) + 1;
  27.     end;
  28.   t_exit(1);                           { stop the timer }
  29.   t_stop;                              { un-init the timer }
  30.   t_ask_timer(1,hits,elapsed);
  31.   writeln ('stop');
  32.   writeln;
  33.   writeln ('Elapsed time for 2500 iterations was ',
  34.   (elapsed/1000000.0):10:6,' seconds,');
  35.   writeln ('and the resolution for ''A'' was ',(a/(iloop+1)) : 15:14);
  36. end.
  37.  
  38.